/**
 * @author: wuji
 * @file:  main
 * @desc:
 * @date: 2020/4/23 7:31 下午
 */

package main

import (
	"context"
	"fmt"
	"google.golang.org/grpc"
	"grpc_demo/hello"
)

func main()  {
	conn,err := grpc.Dial("127.0.0.1:8080",grpc.WithInsecure())
	if err!=nil{
		panic(err)
	}
	defer conn.Close()
	c := hello.NewGreeterClient(conn)
	r,err := c.SayHello(context.Background(),&hello.HelloRequest{Name:"ucan"})
	if err!=nil{
		panic(err)
	}
	fmt.Println(r.Message)
}
